home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / powerpc / include / asm / parport.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  977 b   |  40 lines

  1. /*
  2.  * parport.h: platform-specific PC-style parport initialisation
  3.  *
  4.  * Copyright (C) 1999, 2000  Tim Waugh <tim@cyberelk.demon.co.uk>
  5.  *
  6.  * This file should only be included by drivers/parport/parport_pc.c.
  7.  */
  8.  
  9. #ifndef _ASM_POWERPC_PARPORT_H
  10. #define _ASM_POWERPC_PARPORT_H
  11. #ifdef __KERNEL__
  12.  
  13. #include <asm/prom.h>
  14.  
  15. static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
  16. {
  17.     struct device_node *np;
  18.     const u32 *prop;
  19.     u32 io1, io2;
  20.     int propsize;
  21.     int count = 0;
  22.     for (np = NULL; (np = of_find_compatible_node(np,
  23.                               "parallel",
  24.                               "pnpPNP,400")) != NULL;) {
  25.         prop = of_get_property(np, "reg", &propsize);
  26.         if (!prop || propsize > 6*sizeof(u32))
  27.             continue;
  28.         io1 = prop[1]; io2 = prop[2];
  29.         prop = of_get_property(np, "interrupts", NULL);
  30.         if (!prop)
  31.             continue;
  32.         if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
  33.             count++;
  34.     }
  35.     return count;
  36. }
  37.  
  38. #endif /* __KERNEL__ */
  39. #endif /* !(_ASM_POWERPC_PARPORT_H) */
  40.